Skip to content

feat(growth): add Phase 0 — daily tweet draft + X mention engagement - #3316

Merged
AhmedTMM merged 4 commits into
mainfrom
feat/x-growth-phase0
Apr 17, 2026
Merged

feat(growth): add Phase 0 — daily tweet draft + X mention engagement#3316
AhmedTMM merged 4 commits into
mainfrom
feat/x-growth-phase0

Conversation

@la14-1

@la14-1 la14-1 commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds Phase 0 to the growth agent, running before Reddit scanning each cycle
  • Phase 0a — Tweet Draft (always runs): Reads last 7 days of git commits → Claude drafts a ≤280 char tweet about new features, fixes, or best practices → posts Block Kit card to Slack
  • Phase 0b — X Mention Search (credential-gated): x-fetch.ts searches X API v2 for Spawn/OpenRouter mentions → Claude scores and drafts engagement replies → posts card to Slack
  • All cards require human approval in #spawn-growth — nothing is ever auto-posted to X
  • Phase 0b gracefully skips when X_API_KEY is not set; auto-activates when credentials are added

New files

  • tweet-prompt.md — Claude prompt for tweet generation from git history
  • x-engage-prompt.md — Claude prompt for scoring X mentions + drafting replies
  • x-fetch.ts — X API v2 search client with OAuth 1.0a, valibot schemas, dedup against DB

Modified files

  • growth.sh — Phase 0a + 0b before Phase 1, cleanup trap updates for new temp files/PIDs
  • helpers.tstweets table schema, TweetRow interface + CRUD, logTweetDecision()
  • main.tsTweetPayloadSchema, XEngagePayloadSchema, postTweetCard(), postXEngageCard(), 8 new Slack action handlers (approve/edit/skip for both tweet + engage)

Test plan

  • bash -n growth.sh — syntax check passes
  • bun build — all 4 TypeScript files compile clean
  • Zero as type assertions in all modified files
  • Trigger growth cycle → verify Phase 0a runs, drafts tweet card in Slack
  • Verify Phase 0b logs "skipping (no X credentials)" gracefully
  • Click Approve/Edit/Skip on tweet card → verify DB updates + Slack message replacement
  • Add X credentials → verify Phase 0b activates and engage cards appear

Filed from Slack by SPA

🤖 Generated with Claude Code

claude and others added 4 commits April 17, 2026 00:05
Adds a new Phase 0 to the growth agent cycle that runs before Reddit
scanning:

Phase 0a — Tweet Draft (always runs):
- Gathers last 7 days of git commits
- Claude drafts a single ≤280 char tweet about features, fixes, or best
  practices
- Posts Block Kit card to #C0ARSCAP4MN with Approve/Edit/Skip buttons

Phase 0b — X Mention Search (runs only if X_API_KEY is set):
- x-fetch.ts searches X API v2 for Spawn/OpenRouter mentions
- Claude scores mentions and drafts engagement replies
- Posts engagement card to #C0ARSCAP4MN with approval buttons
- Gracefully skips when no X credentials are configured

All cards require human approval — nothing is ever auto-posted.

New files:
- tweet-prompt.md: Claude prompt for tweet generation
- x-engage-prompt.md: Claude prompt for X engagement scoring
- x-fetch.ts: X API v2 search client with OAuth 1.0a

Modified files:
- growth.sh: Phase 0a + 0b insertion, cleanup trap updates
- helpers.ts: tweets table schema, TweetRow CRUD, logTweetDecision()
- main.ts: TweetPayloadSchema, XEngagePayloadSchema, postTweetCard(),
  postXEngageCard(), 8 new Slack action handlers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Ahmed Abushagur <ahmed@abushagur.com>
Signed-off-by: Ahmed Abushagur <ahmed@abushagur.com>
@AhmedTMM
AhmedTMM merged commit e0f37f0 into main Apr 17, 2026
5 checks passed
@AhmedTMM
AhmedTMM deleted the feat/x-growth-phase0 branch April 17, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants